Skip to main content

Profiler Class

Description:

  A class for profiling functions.

EventName

Type: Readonly Field.

Description:

  The name of the profiling event.

Signature:

const EventName: string

level

Type: Field.

Description:

  The current level of profiling.

Signature:

level: integer

__call

Type: Metamethod.

Description:

  Calls a function and return the amount of time it took to execute.

Signature:

metamethod __call: function(self: ProfilerClass, funcForProfiling: function): number

Usage:

local time = Profiler(myFunction)

Parameters:

ParameterTypeDescription
funcForProfilingfunctionThe function to profile.

Returns:

Return TypeDescription
numberThe amount of time it took to execute the function.